﻿@{
    ViewBag.Title = "部门管理";
    Layout = "~/Views/Shared/_JuiLayout.cshtml";

    string pid = MyRequest.GetQueryString("pid");
    string pidName = "根目录";
    if(pid!="0")
    {
        pidName = selectControlBLL.getNameById("id", pid, "Sys_IBDepartments", "Name");
    }
    string addurl = "/SysMenu/Add?menu=Department&name=AddNode&pid=" + pid;

    string editurl = "/SysMenu/Edit/{id}?menu=Department&name=Edit&tname=" + DencryptHelper.Encrypt("Sys_IBDepartments");

    string tname = "Sys_IBDepartments";
    string url = "/SysMenu/Department/List";
}
@section header {
    <link href="/content/jui-normal.css" rel="stylesheet" type="text/css" />
}
<div id="layout" class="">
    <div id="navTab" class="">
        <h2 class="contentTitle">
            部门菜单组管理</h2>
        <div class="pageHeader">
            <div class="searchBar">
                <table class="searchContent">
                    <tbody>
                        <tr>
                            <th>
                                所属上级:
                            </th>
                            <td>
                                @pidName
                            </td>
                            <th>
                                名称：
                            </th>
                            <td>
                                @Html.TextBox("txt_Name", "")
                            </td>
                            <th>
                                状态：
                            </th>
                            <td>
                                @{ Html.RenderPartial("~/Views/Shared/ForStates.cshtml"); }
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="subBar">
                    <ul>
                        <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="button" onclick="loadList(0);">
                                        查询</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="pageContent">
            <div class="panelBar">
                <ul class="toolBar">
                    <li><a id="addNode" class='add' href='@addurl'><span>新增</span></a> </li>
                    <li><a class="edit" href='@editurl' target="editblank" rel="ids"><span>修改</span></a></li>
                    <li>@Html.Raw(JUIResult.ReturnOpen(tname, url, "1"))</li>
                    <li>@Html.Raw(JUIResult.ReturnDel(tname, url, "1"))</li>
                    <li class="line">line</li>
                </ul>
            </div>
            <!--加载列表-->
            <div id="listDt" class="pageContent">
            </div>
        </div>
    </div>
</div>

<link href="../../content/jui-normal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/pager.js"></script>
<script language="javascript" type="text/javascript">
    var vname = '@DencryptHelper.Encrypt("Sys_IBDepartments")';
    $(function () {
        var control = "SysMenu", node1 = "Department", node2 = "List";
        

        loadList(0, 1);
    });
    function loadList(k, v) {
        var htmlname = "listDt";
        var pars = '@MyRequest.GetQueryString("pid")' + "," + $('#txt_Name').val();
        var name = "0_ParentId__0,0_Name__3";
        pars = encodeURI(pars);
        var tName = '@DencryptHelper.Encrypt("Sys_IBDepartments")';
        var control = "SysMenu/Department/ListControl";
        var datebase = "1";
        var states = $('#states').val();
        list(htmlname, pars, name, tName, control, datebase, states);
    }

</script>